import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import react from '@vitejs/plugin-react'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: [{
      find:'@',
      replacement: fileURLToPath(new URL('./src', import.meta.url))
    }],
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:9528',
        // target: 'http://127.0.0.1:9527',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
